package com.yanqu.road.server.logic.player;

import com.yanqu.road.entity.enums.eSexType;
import com.yanqu.road.logic.config.GameConfig;
import com.yanqu.road.entity.config.system.NpcInfo;
import com.yanqu.road.server.manger.MultipleLanguageMgr;
import com.yanqu.road.server.manger.NameMgr;
import com.yanqu.road.server.manger.DecorationMgr;

public class NpcManager {

	public static NpcInfo getRandomNpc(String language) {
		NpcInfo npcInfo = new NpcInfo();
		String nickName = NameMgr.getRandomName(eSexType.MALE, language);
		npcInfo.setTitleId(1);
		String location = MultipleLanguageMgr.getContent(GameConfig.DEFAULT_LOCATION, language);
		String[] split = location.split(";");
		if (split.length == 5) {
			npcInfo.setWorld(split[0]);
			npcInfo.setContinent(split[1]);
			npcInfo.setCountry(split[2]);
			npcInfo.setProvince(split[3]);
			npcInfo.setCity(split[4]);
		} else {
			npcInfo.setCity(location);
		}
		npcInfo.setNickName(nickName);
		npcInfo.setDecoration(DecorationMgr.getDefaultDecoration(eSexType.MALE.getValue()));
		npcInfo.setVipExp(0);
		return npcInfo;
	}
}
